import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false

// npm install element-ui

//引入ElementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// npm install qs

//引入qs框架
import qs from 'qs'
Vue.prototype.qs=qs;

// npm install axios
//Axios
import axios from 'axios'
Vue.prototype.axios=axios;

//重写方法解决跳转到同一路由报错问题
const myReplace = router.replace;
router.replace = function replace(location) {
  return myReplace.call(this,location).catch(err=>err);
};

const myPush = router.push;
router.push = function push(location) {
  return myPush.call(this,location).catch(err=>err);
};



new Vue({
  router,
  store,
  render: function (h) { return h(App) }
}).$mount('#app')
